using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableHeroEmojiResDao:DaoBase<TableHeroEmojiRes>
    {
        public override void AddPrimaryIndex(TableHeroEmojiRes model)
        {
            cachePrimary[model.EmojiId.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableHeroEmojiRes.txt";
        }

        protected override TableHeroEmojiRes ParseRowData(string[] rowData)
        {
            TableHeroEmojiRes data = new TableHeroEmojiRes();
			data.EmojiId = rowData [0];
			data.ModelName = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.ExpressType = 0;
            }
            else
            {
                data.ExpressType = int.Parse(rowData[2]);
            }
			data.FaceName = rowData [3];

            return data;
        }


        public override void AddOneIndex(TableHeroEmojiRes model)
        {
            if (!cacheOneIndex.ContainsKey(model.ModelName.ToString()))
            {
                cacheOneIndex[model.ModelName.ToString()] = new List<TableHeroEmojiRes>();
            }
            cacheOneIndex[model.ModelName.ToString()].Add(model);
        }
    

    }

}
